home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / dsp / dspgroup / fft32010.arc / PROGRAM.9 < prev    next >
Encoding:
Text File  |  1984-11-13  |  1.9 KB  |  92 lines

  1.     IDT 'CONV'
  2. ************************************************************************
  3. *
  4. *    A general routine for a length-N linear convolution.
  5. *    For this particular implementation, N = 32 and implements
  6. *    a bandpass FIR filter with linear phase.
  7. *
  8. ************************************************************************
  9. *
  10. XNEW    EQU 0        * Newest input sample (always at location 0)
  11. X    EQU 31        * End of data points X
  12. H    EQU 63        * End of impulse response sequence
  13. YOUT    EQU 64        * Output location
  14. ONE    EQU 65        * Contains the value 1
  15. *
  16.     AORG 0
  17.     B START     * Branch to the beginning of the program
  18. *
  19. * Impulse response terms.
  20. *
  21. H1    DATA >02C0
  22. H2    DATA >00E9
  23. H3    DATA >FFC6
  24. H4    DATA >01B5
  25. H5    DATA >FFCD
  26. H6    DATA >FA22
  27. H7    DATA >FBC3
  28. H8    DATA >0380
  29. H9    DATA >03A5
  30. H10    DATA >FFE6
  31. H11    DATA >0694
  32. H12    DATA >0AB0
  33. H13    DATA >F6A8
  34. H14    DATA >E250
  35. H15    DATA >F6BA
  36. H16    DATA >1F1C
  37. H17    DATA >1F1C
  38. H18    DATA >F6BA
  39. H19    DATA >E250
  40. H20    DATA >F6A8
  41. H21    DATA >0AB0
  42. H22    DATA >0694
  43. H23    DATA >FFE6
  44. H24    DATA >03A5
  45. H25    DATA >0380
  46. H26    DATA >FBC3
  47. H27    DATA >FA22
  48. H28    DATA >FFCD
  49. H29    DATA >01B5
  50. H30    DATA >FFC6
  51. H31    DATA >00E9
  52. H32    DATA >02C0
  53. *
  54. * Begin Program.
  55. *
  56. START    LDPK 0
  57.     LACK 1
  58.     SACL ONE    * ONE = 1
  59. *
  60.     LARK AR0,H    * AR0 addresses data locations
  61.     LARK AR1,31    * AR1 is used as a loop counter
  62.     LACK H32
  63. LOADH    LARP AR0    * Load the impulse response
  64.     TBLR *-,AR1
  65.     SUB ONE
  66.     BANZ LOADH
  67. *
  68.     LARK AR1,X    * AR1 used to address data and as a counter
  69.     ZAC
  70. LOADX    SACL *        * Initialize filter
  71.     BANZ LOADX
  72. *
  73.     LARP AR0
  74. NXTPT    IN XNEW,PA0    * Get next input sample
  75. *
  76.     LARK AR0,X    * AR0 points to the input sequence
  77.     LARK AR1,H    * AR1 points to the impulse response
  78. *
  79.     ZAC
  80.     LT *-,AR1
  81.     MPY *-,AR0
  82. LOOP    LTD *,AR1    * Load and move input sequence, accumulate result
  83.     MPY *-,AR0    * Multiply impulse response
  84.     BANZ LOOP    * Loop N times
  85. *
  86.     APAC        * Accumulate last multiply
  87.     SACH YOUT,1
  88.     OUT YOUT,PA1    * Output accumulated result
  89. *
  90.     B NXTPT     * Get the next input sample
  91.     END
  92.